import axios from '@/libs/api.request'
import { getToken } from '@/libs/util'


export const login = (data) => {
    return axios.request({
        method: "post",
        url: '/login',
        data: data,
        headers: {
            'Authorization': getToken()
        }
    })
}

export const register = (data) => {
    return axios.request({
        method: "post",
        url: '/register',
        data: data,
        headers: {
            'Authorization': getToken()
        }
    })
}

export const getUserInfo = (data) => {
    return axios.request({
        method: "post",
        url: '/userinfo',
        data: { "username": data },
        headers: {
            'Authorization': getToken()
        }
    })
}